package com.yoyo.itravel.dao;

import com.yoyo.itravel.bean.Artical;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: 文章表相关操作接口（持久层）
 * @Author:Jerry
 * @Date: created in 1:10 2020/6/16
 * @version: 1.0
 */
@Repository
public interface IArticalDao {

    /**
     * 查找所有的文章信息
     */
    @Select("select * from artical order by likes distinct")
    List<Artical> getAll();

    /**
     * 通过城市查找攻略
     * @param acity
     * @return
     */
    @Select("select * from artical where acity = #{acity}")
    List<Artical> selectByCity(String acity);

    /**
     * 通过用户id查找攻略
     * @param uid
     * @return
     */
    @Select("select * from artical where uid = #{uid}")
    List<Artical> selectByUser(String uid);


}
